package com.sphd.restaurantsystem.presenter;


import com.android.volley.VolleyError;
import com.sphd.restaurantsystem.info.TopUpInfo;
import com.sphd.restaurantsystem.model.CzModelImpl;
import com.sphd.restaurantsystem.view.CzView;

import java.util.List;

/**
* Created by Hu on 2016/12/20
*/

public class CzPresenterImpl implements CzPresenter {
    CzModelImpl czModel;
    CzView czView;

    public CzPresenterImpl(CzView czView) {
        this.czView = czView;
        czModel=new CzModelImpl();
    }

    @Override
    public void addData(String url) {
        czView.showLoading();
        czModel.sendUrl(url,this);
    }

    @Override
    public void sendError(VolleyError error) {

    }

    @Override
    public void recList(List<TopUpInfo> topUpInfos) {
        czView.recList(topUpInfos);
        czView.dissLoading();
    }

    @Override
    public void delUrl(String url) {
        czModel.delUrl(url,this);
    }

    @Override
    public void recRes(int res) {
        czView.recRes(res);
        czView.dissLoading();
    }
}